import request from '@/utils/request'

export function add(data) {
  return request({
    url: 'api/jobs/create',
    method: 'post',
    data
  })
}

export function del(ids) {
  const data = { ids: ids }
  return request({
    url: 'api/jobs/delete',
    method: 'post',
    data
  })
}

export function edit(data) {
  return request({
    url: 'api/jobs/update',
    method: 'post',
    data
  })
}

export function updateIsPause(id) {
  const data = { id: id }
  return request({
    url: 'api/jobs/update/is-pause',
    method: 'post',
    data
  })
}

export function execution(id) {
  const data = { id: id }
  return request({
    url: 'api/jobs/execute',
    method: 'post',
    data
  })
}

export function getJobOption() {
  return request({
    url: 'api/jobs/option',
    method: 'post'
  })
}

export default { del, updateIsPause, execution, add, edit }
